package cl.pucv.androidtelemedicina;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AutoCompleteTextView;

public class Principal extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_principal);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_principal, menu);
        return true;
    }

    public void enviarEspecialidad(View botton){
    	AutoCompleteTextView especialidad = (AutoCompleteTextView) findViewById(R.id.agregarEspecialidad);
    	
    	Intent intent = new Intent();
    	intent.setClass(this,Result.class);
    	intent.putExtra("especialidad", especialidad.getText().toString());
    	startActivity(intent);
    }
    
    public void cancelarEspecialidad(View botton){
    	Intent intent = new Intent();
    	intent.setComponent(new ComponentName(this,Result.class));
    	intent.putExtra("cancelar", "cancelar");
    	startActivity(intent);
    }
}
